﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace COFE.Data
{
    public interface IDBOperationProvider
    {
        T ReadDatabase<T>(Func<COFEDB2, T> readAction);
        void ReadDatabase(Action<COFEDB2> readAction);
        void ReadDatabase(COFEDB2 context, Action<COFEDB2> readAction);
        IEnumerable<T> ReadDatabase<T>(Func<COFEDB2, IEnumerable<T>> readAction);
        void ReadDatabase<T>(Func<COFEDB2, T> readAction, Action<COFEDB2, T> processAction);
        V ReadDatabase<T, V>(Func<COFEDB2, T> readAction, Func<COFEDB2, T, V> processAction);

        void UpdateDatabase(Action<COFEDB2> writeAction);
        T UpdateDatabase<T>(Func<COFEDB2, T> writeAction);

        void UpdateDatabase<T>(Func<COFEDB2, T> readAction,
            Action<COFEDB2, T> writeAction);

        void UpdateDatabase<T, T1>(Func<COFEDB2, T> readAction,
            Func<COFEDB2, T, T1> processAction,
            Action<COFEDB2, T, T1> writeAction);


    }
}
